<script setup lang="ts">
import {onMounted} from 'vue';
import { useRouter  } from "vue-router";
import { useTag } from "../../../../store/tag.ts"
import { reactive } from 'vue';
const  storeTag = useTag()
const router = useRouter();
const props = defineProps({
  children:Array
})
const {children} = props;
// console.log('接收',children);
function jumpPage( item ){
  console.log( '路由信息',item )
  router.push({
    name:item.title,
  })
  storeTag.addTag(item)
}
onMounted( ()=>{

} )

import test from "./test.tsx"


</script>
<template>
  <template v-for="( item,index) in children">
    <a-sub-menu v-if=" item.children &&  item.children.length > 0" :title="item.title" :key="item.key" >
      <template #icon>
         <!-- <component :is="IconBulb"/>  -->
         <!-- <IconBulb></IconBulb> -->
         <!-- <icon-bulb /> -->
         <!-- <test></test> -->
          </template>
      <treeMenu :children="item.children"></treeMenu>
    </a-sub-menu>
    <a-menu-item  @click="jumpPage(item)" v-else :key="item.id" >{{item.title}} </a-menu-item>
</template>


</template>

<style scoped>
.menu-demo {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
}
</style>
